package com.bytedance.common.plugin.component;

import android.annotation.TargetApi;
import android.content.res.AssetFileDescriptor;
import android.content.res.AssetManager;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.content.res.XmlResourceParser;
import android.graphics.Movie;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.TypedValue;

import org.xmlpull.v1.XmlPullParserException;

import java.io.IOException;
import java.io.InputStream;

public class MyResources extends Resources {
    private Resources mBaseResources;

    public MyResources(AssetManager arg1, DisplayMetrics arg2, Configuration arg3) {
        super(arg1, arg2, arg3);
    }

    public XmlResourceParser getAnimation(int arg3) throws Resources.NotFoundException {
        XmlResourceParser v0_1;
        try {
            v0_1 = super.getAnimation(arg3);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.getAnimation(arg3);
            }

            throw v0;
        }

        return v0_1;
    }

    public boolean getBoolean(int arg3) throws Resources.NotFoundException {
        boolean v0_1;
        try {
            v0_1 = super.getBoolean(arg3);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.getBoolean(arg3);
            }

            throw v0;
        }

        return v0_1;
    }

    public int getColor(int arg3) throws Resources.NotFoundException {
        int v0_1;
        try {
            v0_1 = super.getColor(arg3);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.getColor(arg3);
            }

            throw v0;
        }

        return v0_1;
    }

    public ColorStateList getColorStateList(int arg3) throws Resources.NotFoundException {
        ColorStateList v0_1;
        try {
            v0_1 = super.getColorStateList(arg3);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.getColorStateList(arg3);
            }

            throw v0;
        }

        return v0_1;
    }

    public Configuration getConfiguration() {
        return super.getConfiguration();
    }

    public float getDimension(int arg3) throws Resources.NotFoundException {
        float v0_1;
        try {
            v0_1 = super.getDimension(arg3);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.getDimension(arg3);
            }

            throw v0;
        }

        return v0_1;
    }

    public int getDimensionPixelOffset(int arg3) throws Resources.NotFoundException {
        int v0_1;
        try {
            v0_1 = super.getDimensionPixelOffset(arg3);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.getDimensionPixelOffset(arg3);
            }

            throw v0;
        }

        return v0_1;
    }

    public int getDimensionPixelSize(int arg3) throws Resources.NotFoundException {
        int v0_1;
        try {
            v0_1 = super.getDimensionPixelSize(arg3);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.getDimensionPixelSize(arg3);
            }

            throw v0;
        }

        return v0_1;
    }

    public DisplayMetrics getDisplayMetrics() {
        return super.getDisplayMetrics();
    }

    public Drawable getDrawable(int arg3) throws Resources.NotFoundException {
        Drawable v0_1;
        try {
            v0_1 = super.getDrawable(arg3);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.getDrawable(arg3);
            }

            throw v0;
        }

        return v0_1;
    }

    @TargetApi(value=21) public Drawable getDrawable(int arg3, Resources.Theme arg4) throws Resources.NotFoundException {
        Drawable v0_1;
        try {
            v0_1 = super.getDrawable(arg3, arg4);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.getDrawable(arg3, arg4);
            }

            throw v0;
        }

        return v0_1;
    }

    @TargetApi(value=15) public Drawable getDrawableForDensity(int arg3, int arg4) throws Resources.NotFoundException {
        Drawable v0_1;
        try {
            v0_1 = super.getDrawableForDensity(arg3, arg4);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.getDrawableForDensity(arg3, arg4);
            }

            throw v0;
        }

        return v0_1;
    }

    @TargetApi(value=21) public Drawable getDrawableForDensity(int arg3, int arg4, Resources.Theme arg5) {
        Drawable v0_1;
        try {
            v0_1 = super.getDrawableForDensity(arg3, arg4, arg5);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.getDrawableForDensity(arg3, arg4, arg5);
            }

            throw v0;
        }

        return v0_1;
    }

    public float getFraction(int arg3, int arg4, int arg5) {
        float v0_1;
        try {
            v0_1 = super.getFraction(arg3, arg4, arg5);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.getFraction(arg3, arg4, arg5);
            }

            throw v0;
        }

        return v0_1;
    }

    public int getIdentifier(String arg3, String arg4, String arg5) {
        int v0_1;
        try {
            v0_1 = super.getIdentifier(arg3, arg4, arg5);
        }
        catch(NullPointerException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.getIdentifier(arg3, arg4, arg5);
            }

            throw v0;
        }

        return v0_1;
    }

    public int[] getIntArray(int arg3) throws Resources.NotFoundException {
        int[] v0_1;
        try {
            v0_1 = super.getIntArray(arg3);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.getIntArray(arg3);
            }

            throw v0;
        }

        return v0_1;
    }

    public int getInteger(int arg3) throws Resources.NotFoundException {
        int v0_1;
        try {
            v0_1 = super.getInteger(arg3);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.getInteger(arg3);
            }

            throw v0;
        }

        return v0_1;
    }

    public XmlResourceParser getLayout(int arg3) throws Resources.NotFoundException {
        XmlResourceParser v0_1;
        try {
            v0_1 = super.getLayout(arg3);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.getLayout(arg3);
            }

            throw v0;
        }

        return v0_1;
    }

    public Movie getMovie(int arg3) throws Resources.NotFoundException {
        Movie v0_1;
        try {
            v0_1 = super.getMovie(arg3);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.getMovie(arg3);
            }

            throw v0;
        }

        return v0_1;
    }

    public String getQuantityString(int arg3, int arg4) throws Resources.NotFoundException {
        String v0_1;
        try {
            v0_1 = super.getQuantityString(arg3, arg4);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.getQuantityString(arg3, arg4);
            }

            throw v0;
        }

        return v0_1;
    }

    public String getQuantityString(int arg3, int arg4, Object[] arg5) throws Resources.NotFoundException {
        String v0_1;
        try {
            v0_1 = super.getQuantityString(arg3, arg4, arg5);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.getQuantityString(arg3, arg4, arg5);
            }

            throw v0;
        }

        return v0_1;
    }

    public CharSequence getQuantityText(int arg3, int arg4) throws Resources.NotFoundException {
        CharSequence v0_1;
        try {
            v0_1 = super.getQuantityText(arg3, arg4);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.getQuantityText(arg3, arg4);
            }

            throw v0;
        }

        return v0_1;
    }

    public String getResourceEntryName(int arg3) throws Resources.NotFoundException {
        String v0_1;
        try {
            v0_1 = super.getResourceEntryName(arg3);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.getResourceEntryName(arg3);
            }

            throw v0;
        }

        return v0_1;
    }

    public String getResourceName(int arg3) throws Resources.NotFoundException {
        String v0_1;
        try {
            v0_1 = super.getResourceName(arg3);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.getResourceName(arg3);
            }

            throw v0;
        }

        return v0_1;
    }

    public String getResourcePackageName(int arg3) throws Resources.NotFoundException {
        String v0_1;
        try {
            v0_1 = super.getResourcePackageName(arg3);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.getResourcePackageName(arg3);
            }

            throw v0;
        }

        return v0_1;
    }

    public String getResourceTypeName(int arg3) throws Resources.NotFoundException {
        String v0_1;
        try {
            v0_1 = super.getResourceTypeName(arg3);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.getResourceTypeName(arg3);
            }

            throw v0;
        }

        return v0_1;
    }

    public String getString(int arg3) throws Resources.NotFoundException {
        String v0_1;
        try {
            v0_1 = super.getString(arg3);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.getString(arg3);
            }

            throw v0;
        }

        return v0_1;
    }

    public String getString(int arg3, Object[] arg4) throws Resources.NotFoundException {
        String v0_1;
        try {
            v0_1 = super.getString(arg3, arg4);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.getString(arg3, arg4);
            }

            throw v0;
        }

        return v0_1;
    }

    public String[] getStringArray(int arg3) throws Resources.NotFoundException {
        String[] v0_1;
        try {
            v0_1 = super.getStringArray(arg3);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.getStringArray(arg3);
            }

            throw v0;
        }

        return v0_1;
    }

    public CharSequence getText(int arg3) throws Resources.NotFoundException {
        CharSequence v0_1;
        try {
            v0_1 = super.getText(arg3);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.getText(arg3);
            }

            throw v0;
        }

        return v0_1;
    }

    public CharSequence getText(int arg3, CharSequence arg4) {
        CharSequence v0_1;
        try {
            v0_1 = super.getText(arg3, arg4);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.getText(arg3, arg4);
            }

            throw v0;
        }

        return v0_1;
    }

    public CharSequence[] getTextArray(int arg3) throws Resources.NotFoundException {
        CharSequence[] v0_1;
        try {
            v0_1 = super.getTextArray(arg3);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.getTextArray(arg3);
            }

            throw v0;
        }

        return v0_1;
    }

    public void getValue(int arg3, TypedValue arg4, boolean arg5) throws Resources.NotFoundException {
        try {
            super.getValue(arg3, arg4, arg5);
            return;
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                this.mBaseResources.getValue(arg3, arg4, arg5);
            }

            throw v0;
        }
    }

    public void getValue(String arg3, TypedValue arg4, boolean arg5) throws Resources.NotFoundException {
        try {
            super.getValue(arg3, arg4, arg5);
            return;
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                this.mBaseResources.getValue(arg3, arg4, arg5);
            }

            throw v0;
        }
    }

    @TargetApi(value=15) public void getValueForDensity(int arg3, int arg4, TypedValue arg5, boolean arg6) throws Resources.NotFoundException {
        try {
            super.getValueForDensity(arg3, arg4, arg5, arg6);
            return;
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                this.mBaseResources.getValueForDensity(arg3, arg4, arg5, arg6);
            }

            throw v0;
        }
    }

    public XmlResourceParser getXml(int arg3) throws Resources.NotFoundException {
        XmlResourceParser v0_1;
        try {
            v0_1 = super.getXml(arg3);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.getXml(arg3);
            }

            throw v0;
        }

        return v0_1;
    }

    public TypedArray obtainAttributes(AttributeSet arg3, int[] arg4) {
        TypedArray v0_1;
        try {
            v0_1 = super.obtainAttributes(arg3, arg4);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.obtainAttributes(arg3, arg4);
            }

            throw v0;
        }

        return v0_1;
    }

    public TypedArray obtainTypedArray(int arg3) throws Resources.NotFoundException {
        TypedArray v0_1;
        try {
            v0_1 = super.obtainTypedArray(arg3);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.obtainTypedArray(arg3);
            }

            throw v0;
        }

        return v0_1;
    }

    public InputStream openRawResource(int arg3) throws Resources.NotFoundException {
        InputStream v0_1;
        try {
            v0_1 = super.openRawResource(arg3);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.openRawResource(arg3);
            }

            throw v0;
        }

        return v0_1;
    }

    public InputStream openRawResource(int arg3, TypedValue arg4) throws Resources.NotFoundException {
        InputStream v0_1;
        try {
            v0_1 = super.openRawResource(arg3, arg4);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.openRawResource(arg3, arg4);
            }

            throw v0;
        }

        return v0_1;
    }

    public AssetFileDescriptor openRawResourceFd(int arg3) throws Resources.NotFoundException {
        AssetFileDescriptor v0_1;
        try {
            v0_1 = super.openRawResourceFd(arg3);
        }
        catch(Resources.NotFoundException v0) {
            if(this.mBaseResources != null) {
                return this.mBaseResources.openRawResourceFd(arg3);
            }

            throw v0;
        }

        return v0_1;
    }

    public void parseBundleExtra(String arg1, AttributeSet arg2, Bundle arg3) throws XmlPullParserException {
        super.parseBundleExtra(arg1, arg2, arg3);
    }

    public void parseBundleExtras(XmlResourceParser arg1, Bundle arg2) throws XmlPullParserException, IOException {
        super.parseBundleExtras(arg1, arg2);
    }

    public void setmBaseResources(Resources arg1) {
        this.mBaseResources = arg1;
    }

    public void updateConfiguration(Configuration arg3, DisplayMetrics arg4) {
        try {
            super.updateConfiguration(arg3, arg4);
            return;
        }
        catch(Exception v0) {
            if(this.mBaseResources != null) {
                this.mBaseResources.updateConfiguration(arg3, arg4);
            }

            throw v0;
        }
    }
}

